﻿#!/usr/bin/env python
# -*- coding: UTF-8 -*-
 
import os

def clear_sources(list):
    src_path = os.path.abspath(os.path.join(".", ".\\.."))
    
    for root, dirs, files in os.walk(src_path):
        for file in files:
            file_path = os.path.join(root, file)
            for each in list:
                if file_path.endswith(each):
                    os.remove(file_path)

if __name__ == "__main__":
    list = [".pyc", ".pyo"]
    
    clear_sources(list)
